#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<unordered_set>
using namespace std;

class Solution{
    public:
    bool ans1(string ransomNote, string magazine){
        int len = ransomNote.size();
        
        for(int i = 0; i != len; i++){
            char ch = ransomNote[i];
            int pos = magazine.find(ch);
            if(pos == -1){
                return false;
            }
            magazine.erase(pos, 1);
        }

        return true;
    }
};

void test(){
    Solution s;
    string str1 = "aa";
    string str2 = "aab";
    bool ret = s.ans1(str1, str2);
    cout << ret << endl;

}

int main(void){
    test();

    return 0;
}